package com.lagou.service.impl;

import com.lagou.dao.ArticleDao;
import com.lagou.domian.Article;
import com.lagou.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service  //service层的注解标志 表示将service层的对象放入ioc容器中
public class ArticleServiceImpl implements ArticleService {

    @Autowired  //注入Dao层的对象
    private ArticleDao articleDao;

    /**
     * 添加方法
     * @param article
     */
    @Override
    public void save(Article article) {
       //调用dao层的save方法就好了
        //int i = 1/0;
        articleDao.save(article);
    }
}
